package com.bml.architect.framework;

import com.bml.architect.framework.protocol.Protocol;
import com.bml.architect.framework.protocol.dubbo.DubboProtocol;
import com.bml.architect.framework.protocol.http.HttpProtocol;

public class ProtocolFactory {


    public static Protocol getProtocol(){

        String name = System.getProperty("protocol");
        if(null == name || "".equals(name)){
            name = "http";
        }
        if(name.equals("http")){
            return new HttpProtocol();
        }else  if(name.equals("dubbo")){
            return new DubboProtocol();
        }

        return null;
    }
}
